#ifndef _AC_Calypso_OPENCVWIDGET
#define _AC_Calypso_OPENCVWIDGET

class OpenCvWidget : public QWidget {
	Q_OBJECT

	QReadWriteLock mMutex;
	bool mCameraStarted;
	CvCapture * mCapture;
	QImage mCurrentFrame;
	QTimer mRefreshTimer;

	OpenCvWidget(const OpenCvWidget&);

protected:
	void showEvent(QShowEvent * e);
	void hideEvent(QHideEvent * e);
	void paintEvent(QPaintEvent * e);

public:
	OpenCvWidget(QWidget * parent);
	~OpenCvWidget();

	void startCamera();
	void stopCamera();
	QImage getImage();

public slots:
	void nextFrame();
};

#endif